
{include file="public/meta" /}
    

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>关于我们</h5>
                    <div class="ibox-tools">
                        <a class="link">
                            <b>
                                <i class="layui-icon layui-icon-refresh"></i>
                            </b>
                        </a>
                    </div>
                </div>
                <!--form元素开始-->
                <div class="m-t ibox-content layui-form">
                    <div class="layui-form-item">
                        <textarea id="demo" style="display: none;" name="content" lay-verify="content" class="field-content">{$this_data.content}</textarea>
                    </div>
                    <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="component-form-element">修改</button>
                </div>
                <!--form元素结束-->
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['layer','layedit', 'form','jquery'],function() {
        var form = layui.form, layer = layui.layer;
        var $ = layui.$;
        var layedit = layui.layedit;
        layedit.set({
            uploadImage: {
                url: '{:url(\'api/upload/edit_img\')}' //接口url
                ,type: 'post' //默认post
            }
        });
        var index = layedit.build('demo', {
            height: 480 //设置编辑器高度
        }); //建立编辑器
        form.verify({
            content: function (value) {
                return layedit.sync(index);
            }
        })
    })
</script>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(component-form-element)', function (data) {
            //$('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            // var index = layer.load();
            $.ajax({
                url:"{:url('admin/school/index')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.data == 1) {
                        layer.close(index);
                        layer.msg(res.message);
                    } else if (res.data == 0) {
                        layer.close(index);
                        layer.open({
                            title: '添加失败'
                            ,content: res.message
                        });
                    } else {
                        layer.close(index);
                        layer.open({
                            title: '添加失败'
                            ,content: '出现未知错误，如果问题一直出现，您可以联系管理员'
                        });
                    }
                },error:function () {
                    layer.close(index);
                    layer.open({
                        title: '添加失败'
                        ,content: '当前网络环境不安全，拒绝登录，请调整网络环境'
                    });
                }
            })
        });
    });
</script>
    <!-- 全局js -->
    {include file="public/footer" /}
</body>

</html>
